import requests

import config


class TpshopLoginApi(object):
    # 创建session对象
    # session = requests.Session()

    # 发送验证码请求
    @classmethod
    def get_verify(cls, session):
        session.get(url=config.TPSHOP_URL + "/index.php?m=Home&c=User&a=verify")

    # 发送登录请求
    @classmethod
    def login(cls, session, login_data):
        resp = session.post(url=config.TPSHOP_URL + "/index.php?m=Home&c=User&a=do_login",
                            data=login_data)
        return resp
